const { Users, Blogs }  = require('./model');

!(async function(){
    // 创建用户
    const zhangsan = await Users.create({
        username: 'zhangsan',
        password: '123',
        nickname: '张三',
    })
    const zhangsanId = zhangsan.dataValues.id

    const lisi = await Users.create({
        username: 'lisi',
        password: '123',
        nickname: '李四',
    })
    const lisiId = lisi.dataValues.id

    const blog1 = await Blogs.create({
        title: '博客1',
        content: '博客内容1',
        userId: zhangsanId,
    })

    const blog2 = await Blogs.create({
        title: '博客2',
        content: '博客内容2',
        userId: lisiId,
    })

})()